/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package toesp.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author satria.sp
 */
@Entity
@Table(name = "kuliahpt")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Kuliahpt.findAll", query = "SELECT k FROM Kuliahpt k")})
public class Kuliahpt implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "kuliahpt_id")
    private Integer kuliahptId;
    //--------------------------------------------------------------------------
    @Basic(optional = false)
    @Column(name = "tha_id")
    private Integer thaId;
    @Basic(optional = false)
    @Column(name = "kuliah_id")
    private String kuliahId;
    //--------------------------------------------------------------------------
    @Column(name = "kuliahpt_jmlkelas")
    private Integer kuliahptJmlkelas;
    @JoinColumn(name = "tha_id", referencedColumnName = "tha_id", insertable = false, updatable = false)
    @ManyToOne
    private Tha tha;
    @JoinColumn(name = "kuliah_id", referencedColumnName = "kuliah_id", insertable = false, updatable = false)
    @ManyToOne
    private Kuliah kuliah;

    public Kuliahpt() {
    }

    public Kuliahpt(Integer kuliahptId) {
        this.kuliahptId = kuliahptId;
    }

    public Integer getKuliahptId() {
        return kuliahptId;
    }

    public void setKuliahptId(Integer kuliahptId) {
        this.kuliahptId = kuliahptId;
    }

    public Integer getKuliahptJmlkelas() {
        return kuliahptJmlkelas;
    }

    public void setKuliahptJmlkelas(Integer kuliahptJmlkelas) {
        this.kuliahptJmlkelas = kuliahptJmlkelas;
    } 
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (kuliahptId != null ? kuliahptId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Kuliahpt other = (Kuliahpt) obj;
        if (this.thaId != other.thaId && (this.thaId == null || !this.thaId.equals(other.thaId))) {
            return false;
        }
        if ((this.kuliahId == null) ? (other.kuliahId != null) : !this.kuliahId.equals(other.kuliahId)) {
            return false;
        }
        return true;
    }

    /**
     * @return the thaId
     */
    public Integer getThaId() {
        return thaId;
    }

    /**
     * @param thaId the thaId to set
     */
    public void setThaId(Integer thaId) {
        this.thaId = thaId;
    }

    /**
     * @return the kuliahId
     */
    public String getKuliahId() {
        return kuliahId;
    }

    /**
     * @param kuliahId the kuliahId to set
     */
    public void setKuliahId(String kuliahId) {
        this.kuliahId = kuliahId;
    }

    /**
     * @return the tha
     */
    public Tha getTha() {
        return tha;
    }

    /**
     * @param tha the tha to set
     */
    public void setTha(Tha tha) {
        this.tha = tha;
    }

    /**
     * @return the kuliah
     */
    public Kuliah getKuliah() {
        return kuliah;
    }

    /**
     * @param kuliah the kuliah to set
     */
    public void setKuliah(Kuliah kuliah) {
        this.kuliah = kuliah;
    }
    
}
